﻿using System;
using System.Diagnostics.Contracts;
#if NETFX_CORE
using Windows.UI.Xaml.Data;
#else
using System.Globalization;
using System.Windows.Data;
#endif

namespace DaveSexton.Labs
{
	public sealed class InverseBooleanConverter : IValueConverter
	{
#if NETFX_CORE
		public object Convert(object value, Type targetType, object parameter, string language)
#else
		public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
#endif
		{
			Contract.Assume(value is bool);

			return !(bool) value;
		}

#if NETFX_CORE
		public object ConvertBack(object value, Type targetType, object parameter, string language)
#else
		public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
#endif
		{
			Contract.Assume(value is bool);

			return !(bool) value;
		}
	}
}